{% extends "_layouts/edit.html" -%}
{% block body %}
{{ form::input(name="name", title="分类名称", value=row.name) }}
{{ form::remark(value=row.remark) }}
{{ form::seq(value=row.seq) }}
<script>
layui.validators = { 
    name: function(value) { 
        if (value.length < 2 || value.length > 20) { 
            return '名称长度在2-20之间';
        }
    },
    remark: function(value) { 
        if (value.length > 100) { 
            return '备注长度不能超过100';
        }
    },
    seq: function(value) { 
        if (isNaN(value)) { 
            return '排序必须是数字';
        }
    }
};
</script>
{% endblock body -%}
